import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

export default new VueRouter({
	routes: [{
		path: '/login',
		name: 'Login',
		component(resolve) {
			return require(['@comps/login/Login.vue'], resolve)
		},
	}, {
		path: '/ed2kers',
		name: 'ed2kers',
		component(resolve) {
			return require(['@comps/ed2kers/Main.vue'], resolve)
		},
		children: [{
			// 资源列表
			path: 'list',
			name: 'ed2kers_list',
			component(resolve) {
				return require(['@comps/ed2kers/List.vue'], resolve)
			},
		}, {
			// 资源列表
			path: 'detail',
			name: 'ed2kers_detail',
			component(resolve) {
				return require(['@comps/ed2kers/Detail.vue'], resolve)
			},
		}]
	}, {
		path: '/task',
		name: 'task',
		component(resolve) {
			return require(['@comps/task/Main.vue'], resolve)
		},
		children: [{
			// 任务列表
			path: 'list',
			name: 'task_list',
			component(resolve) {
				return require(['@comps/ed2kers/List.vue'], resolve)
			},
		}, {
			// 资源列表
			path: 'detail',
			name: 'ed2kers_detail',
			component(resolve) {
				return require(['@comps/ed2kers/Detail.vue'], resolve)
			},
		}]
	}, {
		path: '/main',
		name: 'Main',
		component(resolve) {
			return require(['@comps/main/Main.vue'], resolve)
		},
		children: [{
			// 匹配后的歌单列表
			path: 'index/match/songlist',
			name: 'match_songlist',
			component(resolve) {
				return require(['@comps/cms/MatchSongList.vue'], resolve)
			},
		}, {
			// Web歌曲列表
			path: 'index/web/songs',
			name: 'web_songs',
			component(resolve) {
				return require(['@comps/cms/WebSongs.vue'], resolve)
			},
		}, {
			// Web歌单列表
			path: 'index/web/songlist',
			name: 'web_songlist',
			component(resolve) {
				return require(['@comps/cms/WebSongList.vue'], resolve)
			},
		}, {
			// Web标签列表
			path: 'index/web/tag',
			name: 'web_tag',
			component(resolve) {
				return require(['@comps/cms/WebTag.vue'], resolve)
			},
		}, {
			// 爱听歌曲列表
			path: 'index/ult/songs',
			name: 'ult_songs',
			component(resolve) {
				return require(['@comps/cms/UltSongs.vue'], resolve)
			},
		}, {
			// 爱听歌曲列表
			path: 'index/cms/task',
			name: 'task',
			component(resolve) {
				return require(['@comps/cms/TaskList.vue'], resolve)
			},
		}]
	}],
})